-module(generator).
-export([f/0,gen/0]).

n_to_str(N) ->
  hd(io_lib:format("~B", [N])).

gen()->
    N=random:uniform(99),
    io:format("number ~p~n",[N]),
    httpc:request(post, {"http://127.0.0.1:666/", [], 
      "application/x-www-form-urlencoded",
      "number=" ++ n_to_str(N)}, [], []),
    timer:sleep(1000),
    gen().
    

f()->
    inets:start(),
    Pid=spawn(generator, gen, []),    
    register("ololo",Pid).
    


